const Mock = require('mockjs')
const Random = Mock.Random

function questionList(opt) {
  const {len = 10, isDeleted = false, isStar = false} = opt
  const List = []
  for (let i = 0; i < len; i++) {
    List[i] = {
      _id: Random.id(),
      title: Random.ctitle(),
      isPublished: Random.boolean(),
      isStar,
      answerCount: Random.natural(50, 100),
      createAt: Random.datetime(),
      isDeleted,
    }
  }
  return List
}

module.exports = questionList
